﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class Admin1_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
           if (Session["ID"] == null)
            {
                //Response.Write("<script>alert('非法登录！');location='../Index.aspx'</script>");
                Response.Write("<script>alert('非法登录！')</script>");
            }
            else
            {
                using (DataClassesDataContext ds = new DataClassesDataContext())
                {
                    var r1 = (from q in ds.admin
                              where q.yonghuming == Convert.ToString(Session["ID"])
                              select q).FirstOrDefault();
                    Label3.Text = r1.yonghuming.ToString();
                }              
                
            }
        }
      
    }
   
}